<?php
ini_set ("display_errors","1" );
	session_start();
	if (!isset($_SESSION['login'])) Header("Location:../../index.php");
        require_once('../controllers/UIs/UIUsuario.php');
?>
<!--?xml version="1.0"?!-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="cs" lang="cs">
<head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <meta http-equiv="content-language" content="cs" />
    <meta name="robots" content="all,follow" />

    <meta name="author" content="All: ... [Nazev webu - www.url.cz]; e-mail: info@url.cz" />
    <meta name="copyright" content="Design/Code: Vit Dlouhy [Nuvio - www.nuvio.cz]; e-mail: vit.dlouhy@nuvio.cz" />
    
    <title>ASODECO encuestas</title>
    <meta name="description" content="..." />
    <meta name="keywords" content="..." />
    
    <link rel="index" href="./" title="Home" />
    <link rel="stylesheet" media="screen,projection" type="text/css" href="../../resources/css/main.css" />
    <link rel="stylesheet" media="print" type="text/css" href="../../resources/css/print.css" />
    <link rel="stylesheet" media="aural" type="text/css" href="../../resources/css/aural.css" />
</head>
<script>
		var nav = (document.layers) ? true : false

		function changeOn(Boton){
			if (!nav && Boton) Boton.src="../../resources/design/saveOn.gif" //modificamos el color
		}

		function changeClick(Boton){
			if (!nav && Boton) Boton.src="../../resources/design/saveOn.gif" //modificamos el color
		}

		function changeOff(Boton){
			if (!nav && Boton) Boton.src="../../resources/design/save.gif" //modificamos el color
		}


function validarInfo()
	{
		var usuario = document.getElementById("usuario").value;
		var clave = document.getElementById("clave").value;
		var confirmarClave = document.getElementById("confirmarClave").value;
		var nombre = document.getElementById("nombre").value;
		var apellido = document.getElementById("apellido").value;
		var correo = document.getElementById("correo").value;
		var msg = "";

		if(usuario == "")
			msg += "    - Usuario\n";

		if(clave == "")
			msg += "    - Clave\n";
		else
		{
			if(clave != confirmarClave)
				msg += "    - La clave que introdujo no coincide con la confirmaciÃ³n.\n";

		}

		if(nombre == "")
			msg += "    - Nombre\n";

		if(apellido == "")
			msg += "    - Apellido\n";

		if(correo == "")
			msg += "    - Correo\n";

		if(msg == "")
			//document.forms.modificarUsuario.submit();
			return true;
		else
		{
			msg = "Por favor verifique lo siguiente:\n" + msg;
			alert(msg);
			return false;
		}

	}
</script>
<body id="www-url-cz">

<!-- Main -->
<div id="main" class="box">

    <!-- Header -->
    <div id="header">

        <!-- Logotyp -->
        <h1 id="logo"><!a href="./" title="Crystal X [Go to homepage]">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>ASODECO </strong><span></span><!/a></h1>
        <hr class="noscreen" />          

        <!-- Quick links -->
        <div class="noscreen noprint">
            <p><em>Quick links: <a href="#content">content</a>, <a href="#tabs">navigation</a>, <a href="#search">search</a>.</em></p>
            <hr />
        </div>

    </div> <!-- /header -->

     <!-- Main menu (tabs) -->
     <div id="tabs" class="noprint">

            <h3 class="noscreen">Navigation</h3>
            <ul class="box">
                <li><a href="../../index.php">Inicio<span class="tab-l"></span><span class="tab-r"></span></a></li>
                <li><a href="empresas.php">Empresas<span class="tab-l"></span><span class="tab-r"></span></a></li>
                <li><a href="instrumentos.php">Instrumentos<span class="tab-l"></span><span class="tab-r"></span></a></li> 
                <li><a href="aplicaciones.php">Aplicaciones<span class="tab-l"></span><span class="tab-r"></span></a></li>
                <li><a href="resultados.php">Resultados<span class="tab-l"></span><span class="tab-r"></span></a></li>
                <li id="active"><a href="usuarios.php">Usuarios<span class="tab-l"></span><span class="tab-r"></span></a></li>
                <li><a href="config.php">Configuración<span class="tab-l"></span><span class="tab-r"></span></a></li>
                <li><a href="sync.php">Sincronizar<span class="tab-l"></span><span class="tab-r"></span></a></li>
            </ul>

        <hr class="noscreen" />
     </div> <!-- /tabs -->

    <!-- Page (2 columns) -->
    <div id="page" class="box">
    <div id="page-in" class="box">


        <?php 
            if (isset($_GET['id']))
                $usu=obtenerUsuarioI($_GET['id']);
            else
                header ("Location: usuarios.php"); ?>
        <!-- Content -->
        <div id="content">

            <!-- Article -->
            <div class="article">
                <h2><span>Modificar Usuario</span></h2>
                <br />
                <p class="info noprint">
                    <span class="cat"><b>Por favor complete los siguientes campos obligatorios (*): </b></span><span class="noscreen">,</span>&nbsp;&nbsp;&nbsp;
                </p>
              <form method="post" action="funcion_modificarUsuario.php" id="modificarUsuario" name="modificarUsuario" OnSubmit="return validarInfo()">
                    <table width="80%">
                        <tr>            
                            <td width="70%"><label>(*) Login de usuario</label></td>
                            <td ><input type="text" name="usuario" id="usuario" class="field" value="<?php echo $usu->login; ?>" tabindex="1" /></td>
                        </tr>
                        <tr>
                            <td width="70%"><label>(*) Contrase&ntilde;a</label></td>
                            <td><input type="password" name="clave" id="clave" class="field" value="<?php echo $usu->password; ?>" tabindex="1" /></td>
                        </tr>
                        <tr>
                            <td width="70%"><label>(*) Confirmar Contrase&ntilde;a</label></td>
                            <td><input type="password" name="confirmarClave" id="confirmarClave" class="field" value="<?php echo $usu->password; ?>" tabindex="1" /></td>
                        </tr>
                        <tr>
                            <td width="70%"><label>(*) Primer Nombre</label></td>
                            <td> <input type="text" name="nombre" id="nombre" class="field" value="<?php echo $usu->nombre; ?>" tabindex="1" /></td>
                        </tr>
                        <tr>
                            <td width="70%"><label>(*) Primer Apellido</label></td>
                            <td><input type="text" name="apellido" id="apellido" class="field" value="<?php echo $usu->apellido; ?>" tabindex="1" /></td>
                        </tr>   
                        <tr>
                            <td width="70%"><label>(*) Correo Electr&oacute;nico</label></td>
                            <td><input type="text" name="correo" id="correo" class="field" value="<?php echo $usu->email; ?>" tabindex="1" /></td>
                        </tr>                                                                     
                        <tr>
                            <td colspan="2" align="right"><br /><input align="right" class="button" type="image" src="../../resources/design/save.gif"  onmouseover="changeOn(this);" onMouseOut="changeOff(this);"  onclick="changeClick(this);" name="btnLogin" />
							<input align="right" type = "reset" class="button" src="../../resources/design/buttonRest.jpg" />
							</td>
                        </tr>
                        <tr><td colspan="2"> <input type="hidden" name="fecha_reg" id="correo" class="field" value="<?php echo $usu->fecha_reg; ?>" tabindex="1" />
                   <input type="hidden" name="fecha_mod" id="correo" class="field" value="<?php echo $usu->fecha_mod; ?>" tabindex="1" />
                   <input type="hidden" name="id_usuario" id="correo" class="field" value="<?php echo $usu->id_usuario; ?>" tabindex="1" />
                   <input type="hidden" name="id" id="correo" class="field" value="<?php echo $usu->id; ?>" tabindex="1" /></td></tr>
                    </table>        
                </form>                
                
            </div> <!-- /article -->

            <hr class="noscreen" />
            
        </div> <!-- /content -->

        <!-- Right column -->
        <div id="col" class="noprint">
            <div id="col-in">

                <!-- About Me -->
			<?php if (isset($_SESSION['login'])) { ?>
                <h3><span>Acerca de M&iacute;</span></h3>
                <div id="about-me">
                    <strong><?php echo $_SESSION['user_name'] ?></strong><br />
                    <?php echo $_SESSION['user_email'] ?><br />
                    Caracas, VEN<br /><br />
                    <a href="../controllers/logout.php">Cerrar Sesi&oacute;n</a></p>
                </div> <!-- /about-me -->
			 <?php } ?>

                <hr class="noscreen" />

            </div> <!-- /col-in -->
        </div> <!-- /col -->

    </div> <!-- /page-in -->
    </div> <!-- /page -->

    <!-- Footer -->
    <div id="footer">
        <div id="top" class="noprint"><p><span class="noscreen">Back on top</span> <a href="#header" title="Back on top ^">^<span></span></a></p></div>
        <hr class="noscreen" />
        
        <p id="createdby">creado por <a href="http://www.asodeco.org">PSC Asodeco</a> <!-- DON´T REMOVE, PLEASE! --></p>
        <p id="copyright">&copy; 2010 <a href="mailto:contacto@asodeco.org">Asodeco</a></p>
    </div> <!-- /footer -->

</div> <!-- /main -->

</body>
</html>
